#pragma once

#include "comServer.h"
#include "board.h"
#include "moveGenerator.h"
#include "gameLog.h"
#include <string>

class GameLoopServer {
public:
	GameLoopServer(ComServer* aServer, std::string logFilename);
	void Run();

private:
	ComServer* server;
	std::string players[2];
	GameLog* log;

	Board currentBoard;
	Move lastMove;

	bool ShakeHand(int clientNumber);
	bool ProcessMove(int clientNumber);
	void EndGame(int winner);

	void Error(std::string errorMsg);
};